import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// 全局样式
import './assets/css/global.css'
// 字体图标
import './assets/fonts/iconfont.css'
import ZkTable from 'vue-table-with-tree-grid'
// 时间格式化插件
import Moment from 'moment'
// 文件域插件
import VueQuillEditor from 'vue-quill-editor'
Vue.use(VueQuillEditor)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

import Axios from 'axios'
Vue.prototype.$http = Axios
Axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
Axios.interceptors.request.use(config => {
    // Do something before request is sent
    config.headers.Authorization = window.sessionStorage.getItem('token')
    return config;
}, error => {
    // Do something with request error
    return Promise.reject(error);
});


Vue.use(ElementUI);
Vue.config.productionTip = false

Vue.component('tree-table', ZkTable)

//自定义moment全局过滤器
Vue.filter('converTime', function(data, formatStr) {
    return Moment(data).format(formatStr);
});

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')